(1) Field of the Invention
This invention relates to an apparatus and method for the dynamic linking of computer software components. Specifically, the field of this invention is that of computer systems where the controlling program logic is divisible into at least two components. One of the software components must provide at least one function or data item accessible by a different software component.
(2) Prior Art
Computer systems, including both hardware and software components, are rapidly becoming more powerful and sophisticated. One reason for the rapid expansion is a system architecture whereby the components of the computer system are designed and built in a modular fashion. As long as the interface between components is established, each modular component can be constructed, modified, and tested independently. Modularity leads to better computer products at minimal cost.
Computer software developers are realizing the advantages of using modular concepts in the design of computer program logic. Engineers are designing logic systems as groups of separate software components (modules), each of which perform specialized tasks. Each component is designed to be as independent and abstract as possible from the other modules. Components are typically designed to be separately compilable. The compiler translates the high level programming language into a processor readable form. The compilation process is well known computer software technique. This process is shown in FIG. 2. The compiled components are bound together into a cohesive operable system (executable) using a static linker. The static linker resolves all of the inter-component accesses and produces a complete executable system.
Software built in modular fashion is more portable to other hardware platforms, more compatible with other software and hardware interfaces, and more easily designed, generated, tested, installed, and maintained. Clearly, complete component independence is not desirable or practical; software components need to be able to communicate with each other for access to information and system resources. Software component interfaces (SCI) are provided in each component for this purpose. The benefits of modularity accrue more rapidly, however, when the SCI is small and the component interfaces are abstracted to the greatest degree possible.
For example, a computer software system might be designed in two components. The first software component provides functions callable by the second software component for the purpose of displaying a circle or a rectangle on the display screen. In this sample software system, the set of functions provided by the first software component represent the SCI. In a less modular implementation of the SCI in this example, separate functions may be provided for displaying the circle, the rectangle, or any other shapes that may be displayable. The second software component is required to explicitly access the appropriate function for displaying the desired shape. This is the typical implementation existing in the art prior to the present invention. This implementation, however fails to fully exploit the advantages of modular software design. If a new shape (e.g. triangle) is required by the second software component, the first software component will have to be modified and regenerated (recompiled and relinked) in order to take advantage of the new function available for displaying triangles. Regeneration of the first software component is often not possible since the source code is not available. Similarly, changes to the calling parameters for any of the SCI functions may force the modification and regeneration of other software components. Undetected runtime parameter mismatches in an improperly configured SCI may cause unpredictable or destructive results.
Modular software design has advanced in the prior art through the use of object-oriented programming. Object-oriented programming allows the software designer to associate a packet of information with a set of functions (methods) for manipulating the information. The information packet with its associated functions is collectively called an object. By accessing a particular object, the programmer gains implicit access to the object's associated functions. Separate interfaces do not need to be explicitly defined.
In an object-oriented system, an object is a software entity representing information and the methods available for manipulating a collection of information. For example, an object called SQUARE may be defined in an object-oriented system. The object represents both information and methods associated with a square. The information retained for the object may include the name or identity of the square, location of the four vertices of the square, the length of the sides, the color of the square, the type of lines (dashed or solid) used to draw the square, etc. Many other parameters or items of information may be necessary or desirable for representing a square in a particular computer system. The methods associated with the object SQUARE may include a function for displaying the square, moving the square, resizing, and removing the square from the display. Many other methods or functions may be appropriate for easily manipulating the square. Each of the functions and items of information for the square are collectively bundled under the object definition (SQUARE).
Object-oriented systems make a distinction between the description of an object and the object itself. More than one similar object may be described by the same general description; thus, in the above example, many squares could be defined with the same object description for SQUARE. The object description is called a class, since the description can be used to describe a type or class of similar objects. An object oriented programming language using objects and classes is described in the book C++ Primer, written by Stanley B. Lippman, Addison Wesley, 1989. Each individual object described by a class is called an instance of that class. The same methods defined for a class can be used to manipulate more than one instance.